package com.zbl.zblproject.erp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbl.zblproject.erp.entity.ErpCategory;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2018/10/9
 */
@Repository
public interface ErpCategoryMapper extends BaseMapper<ErpCategory> {

    /**
     * 查询父级目录
     * @return
     */
    List<ErpCategory> selectFather();

    /**
     * 查询该父级ID下的子节点
     * @param id
     * @return
     */
    List<ErpCategory> selectChildrenByFatherId(int id);

    /**
     * 根据parentId来查询类别
     * @param parentId
     * @return
     */
    List<ErpCategory> selectCategory(int parentId);


    String selectCateNumber(@Param("catId") int catId);

    String selectCateNameByGoodsId(@Param("goodsId") int goodsId);
}
